//
//  MoviePlayerController.m
//  Eyes（Stroyboard）
//
//  Created by lanou on 16/3/1.
//  Copyright © 2016年 雨天记忆. All rights reserved.
//

#import "MoviePlayerController.h"
#import "MoviePlayerView.h"
#import "AppDelegate.h"


@interface MoviePlayerController () <MoviePlayerViewDelegate>
@end

@implementation MoviePlayerController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    NSURL *url = [NSURL URLWithString:self.model.playUrl];

    MoviePlayerView *movieView = [[MoviePlayerView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width) URL:url];
    movieView.model = self.model;
    movieView.delegate = self;
    [self.view addSubview:movieView];
    
}

- (void)back
{
    AppDelegate *delegate = [UIApplication sharedApplication].delegate;
    delegate.isFlip = NO;
    [self dismissViewControllerAnimated:YES completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
